package com.jnevision.menu.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.jnevision.util.DateUtil;

/**
 * <p>
 * 菜单
 * </p>
 *
 * @author gavin
 * @since 2019-07-13
 */
@TableName("sys_menu")
public class Menu extends Model<Menu> {
    private static final long serialVersionUID = -8489762776713052019L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("name")
    private String name;

    @TableField("url")
    private String url;

    @TableField("icon")
    private String icon;

    @TableField("order_num")
    private Integer orderNum;

    @TableField("is_valid")
    @TableLogic
    private Boolean valid;

    @TableField("create_time")
    private String createTime = DateUtil.getNormalTime();

    @TableField("update_time")
    private String updateTime;

    @TableField("parent_id")
    private Integer parentId;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Boolean isValid() {
        return valid;
    }

    public void setValid(Boolean valid) {
        this.valid = valid;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Menu{" + "id=" + id + ", name=" + name + ", url=" + url + ", icon=" + icon + ", orderNum=" + orderNum
            + ", valid=" + valid + ", createTime=" + createTime + ", updateTime=" + updateTime + ", parentId="
            + parentId + "}";
    }
}